package com.TIEmulator;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.DialogInterface.OnClickListener;
import android.util.Log;
import android.webkit.WebView;

class Eula extends AssetHTMLView
{
  private static final String ASSET_EULA = "EULA.html";

  static boolean show(Activity paramActivity)
  {
    TIEmulatorSettings localTIEmulatorSettings = new TIEmulatorSettings(paramActivity);
    WebView localWebView;
    if (!(localTIEmulatorSettings.getEulaAccepted()))
    {
      localWebView = AssetHTMLView.readFile(paramActivity, "EULA.html");
      if (localWebView == null)
        Log.e("Eula", "Cannot read eula asset file!");
    }
    for (int i = 0; ; i = 1)
      while (true)
      {
        return i;
        AlertDialog.Builder localBuilder = new AlertDialog.Builder(paramActivity);
        localBuilder.setTitle(2131165214);
        localBuilder.setCancelable(true);
        localBuilder.setPositiveButton(2131165216, new DialogInterface.OnClickListener(localTIEmulatorSettings, paramActivity)
        {
          public void onClick(DialogInterface paramDialogInterface, int paramInt)
          {
            Eula.this.setEulaAccepted();
            if (!(this.val$activity instanceof AssetHTMLView.HTMLViewerCb))
              return;
            ((AssetHTMLView.HTMLViewerCb)this.val$activity).onAccept();
          }
        });
        localBuilder.setNegativeButton(2131165217, new DialogInterface.OnClickListener(paramActivity)
        {
          public void onClick(DialogInterface paramDialogInterface, int paramInt)
          {
            AssetHTMLView.refuse(Eula.this);
          }
        });
        localBuilder.setOnCancelListener(new DialogInterface.OnCancelListener(paramActivity)
        {
          public void onCancel(DialogInterface paramDialogInterface)
          {
            AssetHTMLView.refuse(Eula.this);
          }
        });
        localBuilder.setView(localWebView);
        localBuilder.create().show();
        i = 0;
      }
  }
}
